<?php
defined('IN_IA') or exit('Access Denied');
global $_W, $_GPC;
$uniacid = $_W['uniacid'];
$list = pdo_fetch("SELECT * FROM " . tablename($this->tablecatedtk) . " WHERE uniacid = '{$uniacid}'");
if ($list) {
	message('已有数据，请清空后重试！', referer(), 'error');
} else {
	$autodata = "服装|../addons/bsht_tbk/res/icon/1.png|1|99|1,母婴|../addons/bsht_tbk/res/icon/5.png|1|98|2,化妆品|../addons/bsht_tbk/res/icon/6.png|1|97|3,居家|../addons/bsht_tbk/res/icon/7.png|1|96|4,鞋包配饰|../addons/bsht_tbk/res/icon/3.png|1|95|5,美食|../addons/bsht_tbk/res/icon/8.png|1|94|6,文体车品|../addons/bsht_tbk/res/icon/9.png|1|93|7,数码家电|../addons/bsht_tbk/res/icon/10.png|1|92|8";
	$autodata = explode(',', $autodata);
	foreach ($autodata as $data) {
		$data = explode('|', $data);
		if (empty($data[1])) {
			$data[1] = '';
		}
		pdo_insert($this->modulename . '_dtk_cate', array('uniacid' => $uniacid, 'name' => $data[0], 'pic' => $data[1], 'status' => '1', 'isindex' => $data[2], 'displayorder' => $data[3], 'cid' => $data[4]));
	}
}
message('初始化分类成功！', referer(), 'success');